#!/bin/bash

echo "=== 环境检查 ==="
echo "当前目录: $(pwd)"
echo "系统: $(uname -a)"
echo

echo "=== Node.js 检查 ==="
if command -v node &> /dev/null; then
    echo "✅ Node.js 已安装: $(node --version)"
else
    echo "❌ Node.js 未安装"
fi
echo

echo "=== npm 检查 ==="
if command -v npm &> /dev/null; then
    echo "✅ npm 已安装: $(npm --version)"
else
    echo "❌ npm 未安装"
fi
echo

echo "=== pnpm 检查 ==="
if command -v pnpm &> /dev/null; then
    echo "✅ pnpm 已安装: $(pnpm --version)"
else
    echo "❌ pnpm 未安装"
fi
echo

echo "=== 项目文件检查 ==="
if [ -f "package.json" ]; then
    echo "✅ package.json 存在"
else
    echo "❌ package.json 不存在"
fi
echo

echo "=== 权限检查 ==="
ls -la start.sh
echo

echo "=== 测试命令 ==="
echo "尝试运行: node --version"
node --version
echo "退出代码: $?"
echo

echo "=== 完成 ===" 